package com.aizuda.boot.modules.business.contract.entity.dto;

import com.aizuda.boot.modules.common.constant.enums.OptionTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * @Author sangyirong
 * @ClassName ContractFieldAddOrUpdateDTO
 * @Version 1.0
 * @Date 2025/5/20 17:04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "合同字段新增DTO")
public class ContractFieldAddDTO {

    @Schema(description = "模块ID", required = true)
    private Integer moduleId;

    @Schema(description = "父级字段ID，用于表示字段的所属关系")
    private Long parentFieldId;

    @Schema(description = "字段名称", required = true)
    private String fieldName;

    @Schema(description = "字段唯一编码", required = true)
    private String code;

    @Schema(description = "字段类型", required = true)
    private String fieldType;

    @Schema(description = "字段选项（JSON格式存储）")
    private Map<String, Object> fieldOptionsMap;

    @Schema(description = "字段描述")
    private String fieldDescription;

    @Schema(description = "是否启用该字段")
    private Boolean isEnabled;

    @Schema(description = "数字类型保留小数位数")
    private Integer decimalPlaces;

    @Schema(description = "数字类型单位")
    private String unit;

    @Schema(description = "选项类型字段的子类型")
    private OptionTypeEnum optionType;

    @Schema(description = "该字段是否必填", required = true)
    private Boolean isRequired;

    @Schema(description = "是否系统字段（1-系统，0-非系统）系统字段不可删除", required = true)
    private Boolean isSystem;
} 